package javabean.data;

public class Triangle {
	private double a,b,c,s;
	private boolean ok;
	
	public boolean isOk() {
		if(a+b>c && a+c>b && b+c>a){
			ok=true;
		}
		return ok;
	}
	
	public double getS() {
		if(ok){
			double p=(a+b+c)/2;
			s=Math.sqrt(p*(p-a)*(p-b)*(p-c));
		}
		return s;
	}

	public double getA() {
		return a;
	}

	public void setA(double a) {
		this.a = a;
	}

	public double getB() {
		return b;
	}

	public void setB(double b) {
		this.b = b;
	}

	public double getC() {
		return c;
	}

	public void setC(double c) {
		this.c = c;
	}
	
}
